package KMP算法;

import java.util.Scanner;

public class 学英语 {

    public static String[] num1 = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
    public static String[] num2 = {"ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eightteen", "nineteen"};
    public static String[] num3 = {"twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"};

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long num = 0;
        while (scanner.hasNext()) {
            num = scanner.nextLong();
            System.out.println(parse(num));
        }

    }

    private static String parse(long num) {
        if (num < 0) {
            return "error";
        }
        StringBuilder sBuilder = new StringBuilder();
        long billion = num / 1000000000;
        if (billion != 0) {
            sBuilder.append(thranslate(billion) + " billion ");
        }
        num = num % 1000000000;
        long million = num / 1000000;
        if (million != 0) {
            sBuilder.append(thranslate(million) + " million ");
        }
        num = num % 1000000;
        long thousand = num / 1000;
        if (thousand != 0) {
            sBuilder.append(thranslate(thousand) + " thousand ");
        }
        num = num % 1000;
        if (num != 0) {
            sBuilder.append(thranslate(num));
        }
        return sBuilder.toString().trim();
    }

    private static String thranslate(long num) {
        StringBuilder sBuilder = new StringBuilder();

        long h = num / 100;
        if (h != 0) {
            sBuilder.append(num1[(int) h] + " hundred ");
        }
        num = num % 100;
        long k = num / 10;
        if (k != 0) {
            if (h != 0) {
                sBuilder.append("and ");
            }
            if (k == 1) {
                long t = num % 10;
                sBuilder.append(num2[(int) t]);
            } else {
                sBuilder.append(num3[(int) (k - 2)] + " ");
                if (num % 10 != 0) {
                    sBuilder.append(num1[(int) num % 10]);
                }
            }
        } else if (num % 10 != 0) {
            if (h != 0) {
                sBuilder.append("and ");
            }
            sBuilder.append(num1[(int) (num % 10)]);
        }
        return sBuilder.toString().trim();
    }
}
